# Парсер телеграмм канала
# Не забадь заменить ИМЯ КАНАЛА на свой

from bs4 import BeautifulSoup
import requests
 

url = 'https://t.me/s/ ИМЯ КАНАЛА'

request = requests.get(url)

soup = BeautifulSoup(request.text, 'html.parser')

post = soup.find_all('div', class_='tgme_widget_message_text')

for posts in post:
    print('=' * 50)
    print('\n' + posts.text + '\n')


# for names in name:
    # i = 0
    # print(names)
    # names = names.select('td:nth-of-type(1)')
    # if names is not None:
        # with open('surNames.txt', 'a') as file:
        #     file.write(names[i].text + '\n')
        #     i += 1
